home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / CLOSE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  339 b   |  12 lines

  1. /* close.c --- p 486 */
  2. #include <stdio.h>
  3. #include <io.h>
  4. main()
  5. {
  6.             /* Call close with an invalid file handle. Handles 0
  7.              * thru 4 are in use by stdin, stdout, stderr, stdaux
  8.              * and stdprn. So, let's use handle 5. */
  9.     printf("Attempting to close file handle 5...\n");
  10.     if ( close(5) != 0)
  11.        perror("Close failed");
  12. }